
package card;
import java.sql.*;

/**
 *
 * @author DA5221-GRP63
 */

public class cardConnect {
    public cardConnect()
  {
   try
   {
     Class.forName("com.mysql.jdbc.Driver");
   }catch(ClassNotFoundException ee){  }
    try
    {
      jbInit();
    } catch( Exception ex )
    {
      ex.printStackTrace();
    }
  }

  public static Connection getconn() throws SQLException
  {
    String url="jdbc:mysql://194.47.47.18 :3306/DA5221_GRP3";
    String username="DA5221_GRP3";
    String password="C0PGVV";
    String ipaddress="194.47.47.18";
    final int port = 3306;
    Connection c = DriverManager.getConnection(url,username,password);
    return c;
  }

  public static void close(ResultSet rs)
  {
    try
    {
      if(rs!=null)
      {
        rs.close();
      }
    }catch(Exception ex){}
  }

  public static void close(Statement stmt)
  {
    try
    {
      if(stmt!=null)
        stmt.close();
    }catch(Exception ex){}
  }

  public static void close(Connection conn)
  {
    try
    {
      if(conn!=null)
        conn.close();
    }catch(Exception ex){}
  }

  private static cardConnect dbconn=new cardConnect();
  private void jbInit() throws Exception
  {
  }

}
